<?php

include 'confidential_settings.php';
// This include contains 5 variables:
//  - db_name: database name
//  - table_name_x: table name
//  - username: username
//  - password: password
//  - localhost: host name

$dbh=mysql_connect ($localhost, $username, $password) or die('Cannot connect to the database because: ' . mysql_error());
mysql_select_db ($db_name) or die(mysql_error()); 

$result = mysql_query("SELECT SUM(val) AS sum_val FROM $table_name_gsc WHERE CURDATE() = DATE(date_entered)");

mysql_close($dbh);

mysql_data_seek ($result , 0);
$cum_val  = 0;
if($row = mysql_fetch_array($result)){
	$cum_val = $row['sum_val'];
}

echo $cum_val;

?>





